<template>
  <div>h5相机组件解决小程序拍照兼容</div>
  <div>
    <van-button plain block type="primary" @click="show"
    >hook弹框组件</van-button
    >
    <div>组件加载结果：{{ selectedValue }}</div>
  </div>
</template>

<script setup>
import { ref } from 'vue';

//遮罩层拍照组件
import useTakePhoto from '@/components/functional/useTakePhoto.ts';
import Camera from '@/components/basic/lbt-camera.vue'
const initialModelValue = ref({
  title:'',
});
const selectedValue = ref('');

const { show, hide } = useTakePhoto({
  component: Camera,
  props: {
    zIndex:99999,
    duration:0.5,
    style: { height: '100vh', width: '100vw',display:'flex',alignItems:'center',justifyContent:'center' },
    children: {
      config: initialModelValue.value, // 传递初始值
    },
  },
  onConfirm: (value) => {
    selectedValue.value = value;
  },
  onCancel: () => {},
});
</script>

<style scoped lang="scss"></style>
